package com.tdkj.model.bbs;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * EjfTopic entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ejf_topic", catalog = "west")
public class EjfTopic implements java.io.Serializable {

	// Fields

	private Integer topicId;
	private EjfBoard ejfBoard;
	private Integer sectionId;
	private String userId;
	private String nickname;
	private String remoteIp;
	private String title;
	private String content;
	private Short reward;
	private Integer visits;
	private Integer replies;
	private Short attaches;
	private String attachIcon;
	private String lastPostUser;
	private String lastNickname;
	private Timestamp lastPostTime;
	private String isDigest;
	private String isReplyNotice;
	private String isHidePost;
	private String isSolved;
	private String topScope;
	private Timestamp topExpireDate;
	private String highColor;
	private Timestamp highExpireDate;
	private String state;
	private Timestamp createTime;
	private Timestamp updateTime;
	private String updateUser;
	private Set<EjfAttach> ejfAttachs = new HashSet<EjfAttach>(0);
	private Set<EjfReply> ejfReplies = new HashSet<EjfReply>(0);

	// Constructors

	/** default constructor */
	public EjfTopic() {
	}

	/** minimal constructor */
	public EjfTopic(EjfBoard ejfBoard, String userId, String title, String lastPostUser, Timestamp updateTime) {
		this.ejfBoard = ejfBoard;
		this.userId = userId;
		this.title = title;
		this.lastPostUser = lastPostUser;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public EjfTopic(EjfBoard ejfBoard, Integer sectionId, String userId, String nickname, String remoteIp, String title, String content, Short reward, Integer visits, Integer replies, Short attaches, String attachIcon, String lastPostUser, String lastNickname, Timestamp lastPostTime,
			String isDigest, String isReplyNotice, String isHidePost, String isSolved, String topScope, Timestamp topExpireDate, String highColor, Timestamp highExpireDate, String state, Timestamp createTime, Timestamp updateTime, String updateUser, Set<EjfAttach> ejfAttachs,
			Set<EjfReply> ejfReplies) {
		this.ejfBoard = ejfBoard;
		this.sectionId = sectionId;
		this.userId = userId;
		this.nickname = nickname;
		this.remoteIp = remoteIp;
		this.title = title;
		this.content = content;
		this.reward = reward;
		this.visits = visits;
		this.replies = replies;
		this.attaches = attaches;
		this.attachIcon = attachIcon;
		this.lastPostUser = lastPostUser;
		this.lastNickname = lastNickname;
		this.lastPostTime = lastPostTime;
		this.isDigest = isDigest;
		this.isReplyNotice = isReplyNotice;
		this.isHidePost = isHidePost;
		this.isSolved = isSolved;
		this.topScope = topScope;
		this.topExpireDate = topExpireDate;
		this.highColor = highColor;
		this.highExpireDate = highExpireDate;
		this.state = state;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.updateUser = updateUser;
		this.ejfAttachs = ejfAttachs;
		this.ejfReplies = ejfReplies;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "topicID", unique = true, nullable = false)
	public Integer getTopicId() {
		return this.topicId;
	}

	public void setTopicId(Integer topicId) {
		this.topicId = topicId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "boardID", nullable = false)
	public EjfBoard getEjfBoard() {
		return this.ejfBoard;
	}

	public void setEjfBoard(EjfBoard ejfBoard) {
		this.ejfBoard = ejfBoard;
	}

	@Column(name = "sectionID")
	public Integer getSectionId() {
		return this.sectionId;
	}

	public void setSectionId(Integer sectionId) {
		this.sectionId = sectionId;
	}

	@Column(name = "userID", nullable = false, length = 15)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "nickname", length = 15)
	public String getNickname() {
		return this.nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "remoteIP", length = 25)
	public String getRemoteIp() {
		return this.remoteIp;
	}

	public void setRemoteIp(String remoteIp) {
		this.remoteIp = remoteIp;
	}

	@Column(name = "title", nullable = false, length = 100)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "content", length = 16777215)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "reward")
	public Short getReward() {
		return this.reward;
	}

	public void setReward(Short reward) {
		this.reward = reward;
	}

	@Column(name = "visits")
	public Integer getVisits() {
		return this.visits;
	}

	public void setVisits(Integer visits) {
		this.visits = visits;
	}

	@Column(name = "replies")
	public Integer getReplies() {
		return this.replies;
	}

	public void setReplies(Integer replies) {
		this.replies = replies;
	}

	@Column(name = "attaches")
	public Short getAttaches() {
		return this.attaches;
	}

	public void setAttaches(Short attaches) {
		this.attaches = attaches;
	}

	@Column(name = "attachIcon", length = 5)
	public String getAttachIcon() {
		return this.attachIcon;
	}

	public void setAttachIcon(String attachIcon) {
		this.attachIcon = attachIcon;
	}

	@Column(name = "lastPostUser", nullable = false, length = 15)
	public String getLastPostUser() {
		return this.lastPostUser;
	}

	public void setLastPostUser(String lastPostUser) {
		this.lastPostUser = lastPostUser;
	}

	@Column(name = "lastNickname", length = 15)
	public String getLastNickname() {
		return this.lastNickname;
	}

	public void setLastNickname(String lastNickname) {
		this.lastNickname = lastNickname;
	}

	@Column(name = "lastPostTime", length = 19)
	public Timestamp getLastPostTime() {
		return this.lastPostTime;
	}

	public void setLastPostTime(Timestamp lastPostTime) {
		this.lastPostTime = lastPostTime;
	}

	@Column(name = "isDigest", length = 1)
	public String getIsDigest() {
		return this.isDigest;
	}

	public void setIsDigest(String isDigest) {
		this.isDigest = isDigest;
	}

	@Column(name = "isReplyNotice", length = 1)
	public String getIsReplyNotice() {
		return this.isReplyNotice;
	}

	public void setIsReplyNotice(String isReplyNotice) {
		this.isReplyNotice = isReplyNotice;
	}

	@Column(name = "isHidePost", length = 1)
	public String getIsHidePost() {
		return this.isHidePost;
	}

	public void setIsHidePost(String isHidePost) {
		this.isHidePost = isHidePost;
	}

	@Column(name = "isSolved", length = 1)
	public String getIsSolved() {
		return this.isSolved;
	}

	public void setIsSolved(String isSolved) {
		this.isSolved = isSolved;
	}

	@Column(name = "topScope", length = 1)
	public String getTopScope() {
		return this.topScope;
	}

	public void setTopScope(String topScope) {
		this.topScope = topScope;
	}

	@Column(name = "topExpireDate", length = 19)
	public Timestamp getTopExpireDate() {
		return this.topExpireDate;
	}

	public void setTopExpireDate(Timestamp topExpireDate) {
		this.topExpireDate = topExpireDate;
	}

	@Column(name = "highColor", length = 6)
	public String getHighColor() {
		return this.highColor;
	}

	public void setHighColor(String highColor) {
		this.highColor = highColor;
	}

	@Column(name = "highExpireDate", length = 19)
	public Timestamp getHighExpireDate() {
		return this.highExpireDate;
	}

	public void setHighExpireDate(Timestamp highExpireDate) {
		this.highExpireDate = highExpireDate;
	}

	@Column(name = "state", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "updateTime", nullable = false, length = 19)
	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "updateUser", length = 15)
	public String getUpdateUser() {
		return this.updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ejfTopic")
	public Set<EjfAttach> getEjfAttachs() {
		return this.ejfAttachs;
	}

	public void setEjfAttachs(Set<EjfAttach> ejfAttachs) {
		this.ejfAttachs = ejfAttachs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ejfTopic")
	public Set<EjfReply> getEjfReplies() {
		return this.ejfReplies;
	}

	public void setEjfReplies(Set<EjfReply> ejfReplies) {
		this.ejfReplies = ejfReplies;
	}

}